package com.atguigu.servlet;

import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
public class Servlet1 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ServletConfig servletConfig = getServletConfig();
        System.out.println("servletConfig");
        System.out.println(servletConfig.getInitParameter("keya"));
        System.out.println("servletContext");
        System.out.println(servletConfig.getServletContext().getInitParameter("username"));
        super.service(req, resp);
    }
}